From 55a5ffdf5c3e44379aaa61590156bd989358579f Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Thu, 20 Jul 2017 13:32:55 +0100 Subject: Remove stricmp macro in favour of NoCaseCompare --- src/Globals.h | 2 -- src/StringUtils.cpp | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Globals.h b/src/Globals.h index e4adb166c..13e793259 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -87,8 +87,6 @@ #define OBSOLETE __attribute__((deprecated)) // Some portability macros :) - #define stricmp strcasecmp - #define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex))) #if defined(_WIN32) diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index 4ff556277..42d736a8c 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -329,11 +329,9 @@ AString StrToUpper(const AString & s) int NoCaseCompare(const AString & s1, const AString & s2) { #ifdef _MSC_VER - // MSVC has stricmp that compares case-insensitive: return _stricmp(s1.c_str(), s2.c_str()); #else - // Do it the hard way - convert both strings to lowercase: - return StrToLower(s1).compare(StrToLower(s2)); + return strcasecmp(s1.c_str(), s2.c_str()); #endif // else _MSC_VER } -- cgit v1.2.3